import com.alibaba.fastjson.JSONObject;
import com.atm.thirdplt.ThirdPltApplication;
import com.atm.thirdplt.common.core.domain.his.HisDeptDict;
import com.atm.thirdplt.component.HisDataHandler;
import com.atm.thirdplt.core.quartz.ThirdTask;
import com.atm.thirdplt.feign.ISysTestService;
import com.atm.thirdplt.service.IHisInfQueryService;
import com.atm.thirdplt.service.IHisInfService;
import com.atm.thirdplt.service.ILisInfService;
import com.atm.thirdplt.service.ISysJobService;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.annotation.Rollback;
import org.springframework.test.context.junit4.SpringRunner;

import javax.annotation.Resource;
import java.util.List;

/** @ClassName ATMTest2 @Description TODO @Author wenyf @Date 2020/10/27 9:36 @Version 1.0 */
@RunWith(SpringRunner.class)
@SpringBootTest(classes = ThirdPltApplication.class)
public class ATMTest2 {

    @Autowired
    private IHisInfService hisInfService;

    @Autowired
    private ISysTestService sysTestService;

    @Autowired
    private ISysJobService sysJobService;

    @Resource(name = "thirdTask")
    private ThirdTask thirdTask;

    @Autowired
    private HisDataHandler hisDataHandler;

    @Autowired
    @Qualifier("viewQuery")
    private IHisInfQueryService hisInfQueryService;

    @Autowired
    private ILisInfService lisInfService;

    @Test
    @Rollback(false)
    public void test1() {
        // System.out.println(sysJobService.selectJobList(null).size());
//        List<HisDeptDict> list = hisInfQueryService.selDeptDic();
//        System.out.println(JSONObject.toJSONString(hisInfService.selDeptDic()));

//        sysJobService.selectJobList(null);
        //List<HisDeptDict> list1 = hisInfService.selDeptDic();
        // hisInfService.delHisDept();
//        hisInfService.saveDept(list);

        //hisInfService.syncDeptDict();
//        System.out.println(JSONObject.toJSONString(hisInfQueryService.selDeptDic()));

        System.out.println("test1");

        // System.out.println(sysJobService.selectJobList(null).size());
    }

    @Test
    @Rollback(false)
    public void test2() {

        //sysTestService.selectTestStr();
        //List<String> list = new ArrayList<>();
        // list.add("");
//        HisPatMasterIndex aa = new HisPatMasterIndex();
        //hisInfService.selPatInfHis(list);
//        List<HisPatMasterIndex> list = new ArrayList<>();
//        HisPatMasterIndex aa = new HisPatMasterIndex();
//        aa.setPatientId("sdfs");
//        aa.setIdNo("sdfdsf");
//        list.add(aa);
//        hisInfService.savePatMasMongo(list);
        //hisDataHandler.syncSchedule("2020/03/21 20:30:00", "2016/3/23 20:30:00");
        //hisDataHandler.syncSchedule("2020/3/21 14:00:00", "2020/03/25 23:59:59");
        //lisInfService.delLabMasterMongo("123", 11);
        //HisPatsInHospital mm = hisDataHandler.queryPatInHos("16030515", "");
        //System.out.println(mm.getCreateDate());
        //System.out.println(mm.getDateOfBirth());
//        List<HisOperationSchedule> list = hisDataHandler.queryOperSche("16030730", null, "2016/3/24 7:30:00",
//        "2016/3" +
//                "/24 " +
//                "9:30:00");
//        List<HisScheduledOperationName> list = hisDataHandler.queryOperScheName("16030486", "1", "1");
//        System.out.println(JSONObject.toJSONString(list));
    }
}
